package com.framework.applogic;

public class NavigationHelper extends DriverBasedHelper {

    private String baseUrl;

    public NavigationHelper(ApplicationManager app) {
        super(app.getWebDriver());
        this.baseUrl = app.getBaseUrl();
    }

    //Methods
    public void openMainPage() {
        driver.get("http://localhost/php4dvd/");
        pages.mainPage.ensureContentLoaded();
    }

    public void openRelativeUrl(String url) {
        driver.get(baseUrl + url);
    }

    public void gotoUserProfilePage() {
        pages.internalPage.ensurePageLoaded().clickUserProfilePage();
        //driver.findElement(By.cssSelector("nav a[href $= '?go=profile']"))
        //  .click();
        // openRelativeUrl("?go=profile");
    }

    public void gotoUserManagementPage() {
        pages.internalPage.ensurePageLoaded().clickUserManagementLink();
        //driver.findElement(By.cssSelector("nav a[href $= '?go=users']"))
        //  .click();
        //openRelativeUrl("?go=users");
    }

}
